package com.wuhongyu.repository;

import com.wuhongyu.base.BaseDao;
import com.wuhongyu.entity.Cons;
import com.wuhongyu.entity.Dictionary;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface DictionaryDao extends BaseDao<Dictionary> {

    List<Dictionary> findByTypeEquals(String type);

    //统计企业客户等级对应的客户数量
    @Query(nativeQuery = true)
    List<Cons> findByGrade();

    //统计客户信用度对应的客户数量
    @Query(nativeQuery = true)
    List<Cons> findByCredit();

    //统计客户满意度对应的客户数量
    @Query(nativeQuery = true)
    List<Cons> findBySatisfied();

    //统计服务
    @Query(nativeQuery = true)
    List<Cons> findServerByYear(String year);

    @Query(nativeQuery = true)
    List<Cons> findServer();
}
